package com.gf.forcesystem.mq.weatherparse;

import com.gf.forcesystem.model.dto.weather.AbstractWeather;
import com.gf.forcesystem.model.dto.weather.Rain;
import org.springframework.stereotype.Service;

import java.nio.ByteBuffer;

/**
 * @author gaofei
 * @date 2022/6/24 21:31
 */
@Service("RainParse")
public class RainParse implements IWeatherParse{
    @Override
    public byte identifier() {
        return (byte) 0xC2;
    }

    @Override
    public AbstractWeather parse(ByteBuffer byteBuffer) {
        Rain rain = new Rain();
        rain.setType(byteBuffer.get());
        return rain;
    }
}
